home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / setlocale.z / setlocale
Encoding:
Text File  |  1998-10-20  |  13.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. sssseeeettttllllooooccccaaaalllleeee((((3333CCCC))))                                                    sssseeeettttllllooooccccaaaalllleeee((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee - modify and query a program's locale
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_oooo_cccc_aaaa_llll_eeee_...._hhhh_>>>>
  13.  
  14.      _cccc_hhhh_aaaa_rrrr _****_ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee _((((_iiii_nnnn_tttt _cccc_aaaa_tttt_eeee_gggg_oooo_rrrr_yyyy_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_llll_oooo_cccc_aaaa_llll_eeee_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee selects the appropriate piece of the program's locale as
  18.      specified by the _c_a_t_e_g_o_r_y and _l_o_c_a_l_e arguments.  The _c_a_t_e_g_o_r_y argument
  19.      may have the following values: _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE_,,,, _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC_,,,, _LLLL_CCCC______TTTT_IIII_MMMM_EEEE_,,,, _LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE_,,,,
  20.      _LLLL_CCCC______MMMM_OOOO_NNNN_EEEE_TTTT_AAAA_RRRR_YYYY_,,,, _LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS and _LLLL_CCCC______AAAA_LLLL_LLLL_....  These names are defined in the
  21.      _llll_oooo_cccc_aaaa_llll_eeee_...._hhhh header file.  _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE affects the behavior of the character
  22.      handling functions (_iiii_ssss_aaaa_llll_pppp_hhhh_aaaa, _tttt_oooo_llll_oooo_wwww_eeee_rrrr, etc.) and the multibyte character
  23.      functions (such as _mmmm_bbbb_tttt_oooo_wwww_cccc and _wwww_cccc_tttt_oooo_mmmm_bbbb).  _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC affects the decimal-
  24.      point character for the formatted input/output functions and the string
  25.      conversion functions as well as the non-monetary formatting information
  26.      returned by _llll_oooo_cccc_aaaa_llll_eeee_cccc_oooo_nnnn_vvvv [see _llll_oooo_cccc_aaaa_llll_eeee_cccc_oooo_nnnn_vvvv(3C)].  _LLLL_CCCC______TTTT_IIII_MMMM_EEEE affects the
  27.      behavior of _aaaa_ssss_cccc_ffff_tttt_iiii_mmmm_eeee, _cccc_ffff_tttt_iiii_mmmm_eeee, _gggg_eeee_tttt_dddd_aaaa_tttt_eeee, and _ssss_tttt_rrrr_ffff_tttt_iiii_mmmm_eeee.  _LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE affects
  28.      the behavior of _ssss_tttt_rrrr_cccc_oooo_llll_llll and _ssss_tttt_rrrr_xxxx_ffff_rrrr_mmmm.  _LLLL_CCCC______MMMM_OOOO_NNNN_EEEE_TTTT_AAAA_RRRR_YYYY affects the monetary
  29.      formatted information returned by _llll_oooo_cccc_aaaa_llll_eeee_cccc_oooo_nnnn_vvvv.  _LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS affects the
  30.      behavior of _gggg_eeee_tttt_tttt_xxxx_tttt, _cccc_aaaa_tttt_oooo_pppp_eeee_nnnn, _cccc_aaaa_tttt_cccc_llll_oooo_ssss_eeee, and _cccc_aaaa_tttt_gggg_eeee_tttt_ssss [see _cccc_aaaa_tttt_oooo_pppp_eeee_nnnn(3C) and
  31.      _cccc_aaaa_tttt_gggg_eeee_tttt_ssss(3C)].  _LLLL_CCCC______AAAA_LLLL_LLLL names the program's entire locale.
  32.  
  33.      Each category corresponds to a set of databases that contain the relevant
  34.      information for each defined locale.  The location of a database is given
  35.      by the following path, _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_l_o_c_a_l_e_////_c_a_t_e_g_o_r_y, where _l_o_c_a_l_e and
  36.      _c_a_t_e_g_o_r_y are the names of locale and category, respectively.  For
  37.      example, the database for the _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE category for the _""""_gggg_eeee_rrrr_mmmm_aaaa_nnnn_"""" locale
  38.      would be found in _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_gggg_eeee_rrrr_mmmm_aaaa_nnnn_////_LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE.
  39.  
  40.      A value of _""""_CCCC_"""" for _l_o_c_a_l_e specifies the default environment.
  41.  
  42.      A value of _""""_"""" for _l_o_c_a_l_e specifies that the locale should be taken from
  43.      environment variables.  The order in which the environment variables are
  44.      checked for the various categories is given below:
  45.                Category       1st Env. Var.   2nd Env. Var
  46.                ___________________________________________
  47.                _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE_::::      _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE        _LLLL_AAAA_NNNN_GGGG
  48.                _LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE_::::    _LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE      _LLLL_AAAA_NNNN_GGGG
  49.                _LLLL_CCCC______TTTT_IIII_MMMM_EEEE_::::       _LLLL_CCCC______TTTT_IIII_MMMM_EEEE         _LLLL_AAAA_NNNN_GGGG
  50.                _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC_::::    _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC      _LLLL_AAAA_NNNN_GGGG
  51.                _LLLL_CCCC______MMMM_OOOO_NNNN_EEEE_TTTT_AAAA_RRRR_YYYY_::::   _LLLL_CCCC______MMMM_OOOO_NNNN_EEEE_TTTT_AAAA_RRRR_YYYY     _LLLL_AAAA_NNNN_GGGG
  52.                _LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS_::::   _LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS     _LLLL_AAAA_NNNN_GGGG
  53.  
  54.      At program startup, the equivalent of
  55.  
  56.           _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee_((((_LLLL_CCCC______AAAA_LLLL_LLLL_,,,, _""""_CCCC_""""_))))
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssseeeettttllllooooccccaaaalllleeee((((3333CCCC))))                                                    sssseeeettttllllooooccccaaaalllleeee((((3333CCCC))))
  71.  
  72.  
  73.  
  74.      is executed.  This has the effect of initializing each category to the
  75.      locale described by the environment _""""_CCCC_"""".
  76.  
  77.      If a pointer to a string is given for _l_o_c_a_l_e, _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee attempts to set
  78.      the locale for the given category to _l_o_c_a_l_e.  If _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee succeeds,
  79.      _l_o_c_a_l_e is returned.  If _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee fails, a null pointer is returned and
  80.      the program's locale is not changed.
  81.  
  82.      For category _LLLL_CCCC______AAAA_LLLL_LLLL, the behavior is slightly different.  If a pointer to
  83.      a string is given for _l_o_c_a_l_e and _LLLL_CCCC______AAAA_LLLL_LLLL is given for _c_a_t_e_g_o_r_y, _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee
  84.      attempts to set the locale for all the categories to _l_o_c_a_l_e.  The _l_o_c_a_l_e
  85.      may be a simple locale, consisting of a single locale, or a composite
  86.      locale.  A composite locale is a string returned by a previous call to
  87.      _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee with _LLLL_CCCC______AAAA_LLLL_LLLL for which the locale did not consist of identical
  88.      category values.  If _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee fails to set the locale for any category,
  89.      a null pointer is returned and the program's locale for all categories is
  90.      not changed.  Otherwise, a description of the new locale is returned.
  91.  
  92.      A null pointer for _l_o_c_a_l_e causes _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee to return the current locale
  93.      associated with the _c_a_t_e_g_o_r_y.  The program's locale is not changed.
  94.  
  95. FFFFIIIILLLLEEEESSSS
  96.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_CCCC_////_LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE          _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE database for the _CCCC locale
  97.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_CCCC_////_LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC        _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC database for the _CCCC locale
  98.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_CCCC_////_LLLL_CCCC______TTTT_IIII_MMMM_EEEE           _LLLL_CCCC______TTTT_IIII_MMMM_EEEE database for the _CCCC locale
  99.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_CCCC_////_LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE        _LLLL_CCCC______CCCC_OOOO_LLLL_LLLL_AAAA_TTTT_EEEE database for the _CCCC locale
  100.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_CCCC_////_LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS       _LLLL_CCCC______MMMM_EEEE_SSSS_SSSS_AAAA_GGGG_EEEE_SSSS database for the _CCCC locale
  101.      _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_llll_oooo_cccc_aaaa_llll_eeee_////_l_o_c_a_l_e_////_c_a_t_e_g_o_r_y     files containing the locale-specific
  102.                                          information for each locale and
  103.                                          category
  104.  
  105. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  106.      _cccc_tttt_iiii_mmmm_eeee(3C), _cccc_tttt_yyyy_pppp_eeee(3C), _gggg_eeee_tttt_dddd_aaaa_tttt_eeee(3C), _gggg_eeee_tttt_tttt_xxxx_tttt(3G), _llll_oooo_cccc_aaaa_llll_eeee_cccc_oooo_nnnn_vvvv(3C),
  107.      _mmmm_bbbb_cccc_hhhh_aaaa_rrrr(3C), _mmmm_bbbb_ssss_tttt_rrrr_iiii_nnnn_gggg, _ssss_tttt_rrrr_cccc_oooo_llll_llll(3C), _ssss_tttt_rrrr_ffff_tttt_iiii_mmmm_eeee(3C), _ssss_tttt_rrrr_tttt_oooo_dddd(3C), _ssss_tttt_rrrr_xxxx_ffff_rrrr_mmmm(3C),
  108.      _pppp_rrrr_iiii_nnnn_tttt_ffff(3S), _eeee_nnnn_vvvv_iiii_rrrr_oooo_nnnn(5).
  109.  
  110. BBBBUUUUGGGGSSSS
  111.      Because _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee() may call _dddd_llll_oooo_pppp_eeee_nnnn(3), and because _dddd_llll_oooo_pppp_eeee_nnnn(3) calls are
  112.      forbidden from init sections of DSO's, _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee() should not be called
  113.      from such sections.  See _DDDD_SSSS_OOOO(5) for more information.
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.